/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.sx.sx1.lintcode.day717;

/**
 *
 * @author mac
 */
public class LC260 {

    static class Solution {

        /**
         * @param matrix: a matrix
         * @return: return true if same.
         */
        public boolean judgeSame(int[][] matrix) {
            int n = matrix.length;
            int m = matrix[0].length;

            for (int r = 1; r < n; r++) {
                for (int c = 1; c < m; c++) {
                    if (matrix[r][c] != matrix[r - 1][c - 1]) {
                        return false;
                    }
                }

            }

            return true;
        }


    }

    public static void main(String[] args) {
        int[][] arr1 = {{1, 2, 3}, {5, 1, 2}, {6, 5, 1}};
        int[][] arr2 = {{1, 2, 3}, {2, 1, 5}, {6, 5, 1}};

        Solution obj = new Solution();
        System.out.println(obj.judgeSame(arr1));
    }

}
